﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data.Common;
using System.Data;

namespace DataAccess.NHibernateHelper
{
    /// <summary>
    /// Helps with some disposing and closing operations
    /// depending on sent type.
    /// </summary>
    public static class Disposer
    {
        private static void DoDispose(IDisposable obj)
        {
            obj.Dispose();
        }

        public static void TryDispose(NHibSession session)
        {
            if (session != null)
            {
                session.Dispose();
                DoDispose(session);
            }
        }
    }

}
